<template>
  <div id="app">
    <router-view />
  </div>
</template>

<script>
export default {
  name: "App",
  watch: {
    $route(to, form) {
      console.log("to", to);
      if (to.path != "/login") {
        let obj = {
          name: to.name,
          title: to.meta.title
        };
        if (to.path == "/userCenter") {
          obj.name = to.name;
          obj.title = "个人中心";
        }
        // if (to.path == "/") {
        //   obj.name = "Index";
        //   obj.title = "首页";
        // }
        this.$store.commit("addTab", obj);
      }
    }
  }
};
</script>

<style>
#app {
  font-family: "Avenir", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* text-align: center; */
  color: #2c3e50;
  /* margin-top: 60px; */
}
html,
body,
#app {
  height: 100%;
}
body {
  margin: 0px;
}
</style>
